package cn.snowheart.observer.weather.jvm;

import cn.snowheart.observer.weather.jvm.display.CurrentConditionsDisplay;
import cn.snowheart.observer.weather.jvm.display.ForecastDisplay;
import cn.snowheart.observer.weather.jvm.display.StatisticsDisplay;
import cn.snowheart.observer.weather.jvm.weather.WeatherData;

/**
 * @author liuwanxiang
 * @version 2019/06/24
 */
public class JvmObserverTests {

    public static void main(String[] args) {

        WeatherData weatherData = new WeatherData();

        ForecastDisplay forecastDisplay = new ForecastDisplay();
        StatisticsDisplay statisticsDisplay = new StatisticsDisplay();
        CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay();

        weatherData.addObserver(forecastDisplay);
        weatherData.addObserver(statisticsDisplay);
        weatherData.addObserver(currentConditionsDisplay);

        weatherData.setData(10);

    }

}
